{namespace exports}


/**
 * A template for creating an HTML file that summarizes the contents of a
 * single JS file.  The file will contain only a list of type names and their
 * general description text.  The various type params should be arrays of
 * objects containing "name" and "desc" fields.  If a file does not define any
 * of a given type of types, an empty array should be passed.
 *
 * @param head The header, containing the project name and the relative path
 *     to to the file being documented.
 * @param? rev The revision of the file being documented.
 * @param fileoverview The text of the fileoverview tag.
 *
 * @param classes The classes defined in the file.
 * @param interfaces The interfaces defined in the file.
 * @param enums The enums defined in the file.
 * @param typedefs The typedefs defined in the file.
 */
{template .toFileDoc autoescape="false"}
<html>
  <head>
    <title>
      {$head} - File Documentation
    </title>
    <link href="styles/common.css" rel="stylesheet" type="text/css" />
    <link href="styles/file.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <h1 class="f-header">{$head}</h1>
    
    <div class="fileoverview mono">
      {$fileoverview}
    </div>
    
    {if length($typedefs) > 0}
    <div class="typedef-box">
      <h2 class="type-header typedef">Typedefs</h2>
      {foreach $typedef in $typedefs}
        <div class="name typedef">{$typedef.name}</div>
        <div class="type-desc">{$typedef.desc}</div>
      {/foreach}
    </div>
    {/if}
    
    {if length($interfaces) > 0}
    <div class="interface-box">
      <h2 class="type-header interface">Interfaces</h2>
      {foreach $interface in $interfaces}
        <div class="name interface">{$interface.name}</div>
        <div class="type-desc">{$interface.desc}</div>
      {/foreach}
    </div>
    {/if}
    
    {if length($classes) > 0}
    <div class="class-box">
      <h2 class="type-header class">Classes</h2>
      {foreach $class in $classes}
        <div class="mono name class">{$class.name}</div>
        <div class="mono type-desc">{$class.desc}</div>
      {/foreach}
    </div>
    {/if}
    
    {if length($enums) > 0}
    <div class="enum-box">
      <h2 class="type-header enum">Enums</h2>
      {foreach $enum in $enums}
        <div class="mono name enum">{$enum.name}</div>
        <div class="mono type-desc">{$enum.desc}</div>
      {/foreach}
    </div>
    {/if}

    {if $rev}<hr class="footer" /><div class="rev">revision: {$rev}</div>{/if}
  </body>
</html>
{/template}


/**
 * Create a test function for the build script.
 */
{template .test}
Success.
{/template}
